﻿using Mapster;
using SqlSugar;
using Zhp.Common.WebApp;
using Zhp.Entity.Monitor;
using Zhp.IService.Monitor;
using Zhp.Model.Monitor;
using Zhp.Service.Base;
using Zhp.SqlSugar.Repository;

namespace Zhp.Service.Monitor
{
    public class AuditLogService : BaseService<AuditLog>, IAuditLogService
    {

        public AuditLogService(ICurrentUser currentUser, IBaseRepository<AuditLog> rep)
        {
            _currentUser = currentUser;
            _rep = rep;
        }

        public async Task<List<AuditLogModel>> GetAuditLog(AuditLogQuery query)
        {
            var list = await _rep.GetPageListAsync(new List<IConditionalModel>
            {
            }, query, x => x.CreateTime, OrderByType.Desc);

            return list.Adapt<List<AuditLogModel>>();
        }

    }
}
